package cn.zjj.service.impl;

import cn.zjj.domain.User;
import cn.zjj.mapper.UserMapper;
import cn.zjj.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional(readOnly = true,propagation = Propagation.SUPPORTS)
public class UserServiceImpl implements IUserService {
    @Autowired
    private UserMapper userMapper;



    @Override
    public User selectById(Long id) {
        return userMapper.selectById(id);
    }
    @Transactional
    @Override
    public void insert(User user) {
        userMapper.insert(user);
    }
    @Transactional
    @Override
    public void update(User user) {
        userMapper.update(user);
    }

    @Override
    public List<User> select() {

        return userMapper.select();
    }
}
